import 'package:flutter/material.dart';
import 'package:flutter_widgets/flutter_widgets.dart';

class CommonProgressIndicator extends StatelessWidget {
  final CommonProgressIndicatorStyle? style;

  const CommonProgressIndicator({super.key, this.style});

  @override
  Widget build(BuildContext context) {
    final style = this.style ?? WidgetTheme.of(context)?.progressIndicatorStyle;
    return Center(
      child: SizedBox(
        width: style?.size ?? 22,
        height: style?.size ?? 22,
        child: CircularProgressIndicator(
          strokeWidth: style?.strokeWidth ?? 3,
        ),
      ),
    );
  }
}

class CommonProgressIndicatorStyle {
  final double? size;
  final double? strokeWidth;

  const CommonProgressIndicatorStyle({this.size, this.strokeWidth});
}
